package com.snow.springboot.service;

import com.snow.springboot.dao.CategoryInfoMapper;
import com.snow.springboot.pojo.domain.CategoryInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.SQLException;

/**
 * @Package: com.snow.springboot.service
 * @ClassName: CategoryService
 * @Description:疾病类目信息service
 * @author: lurui
 * @Date: 2018/10/23 上午10:48
 * @version:
 */
@Service
public class CategoryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(CategoryService.class);
    @Autowired
    private CategoryInfoMapper categoryMapper;

    /**
     * @Description: 保存疾病分级信息
     * @MethodName: saveCategorl
     * @Param: [categoryInfo]
     * @Return: boolean
     * @Author: lurui
     * @Date: 2018/10/23 上午10:58
     */
    @Transactional(rollbackFor = Throwable.class)
    public boolean saveCategorl(CategoryInfo categoryInfo) throws SQLException{
        boolean flag = false;
        if (1 == this.categoryMapper.insert(categoryInfo)) {
            flag = true;
        }
        return flag;
    }

}
